package co.yixiang.modules.shop.service.impl;

import co.yixiang.modules.shop.domain.YxStoreBonusDetail;
import co.yixiang.modules.shop.repository.YxStoreBonusDetailRepository;
import co.yixiang.modules.shop.service.YxStoreBonusDetailService;
import co.yixiang.modules.shop.service.dto.YxStoreBonusDetailDto;
import co.yixiang.modules.shop.service.mapper.YxStoreBonusDetailMapper;
import co.yixiang.utils.ValidationUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

// 默认不使用缓存

/**
* @author frq
* @date 2020-07-22
*/
@Service
//@CacheConfig(cacheNames = "yxStoreBonusDetail")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class YxStoreBonusDetailServiceImpl implements YxStoreBonusDetailService {
    @Autowired
    private YxStoreBonusDetailRepository yxStoreBonusDetailRepository;
    @Autowired
    private YxStoreBonusDetailMapper yxStoreBonusDetailMapper;



    @Override
    public YxStoreBonusDetailDto findByBonusId(Integer bonusId) {
        YxStoreBonusDetail yxStoreBonusDetail = yxStoreBonusDetailRepository.findByBonusId(bonusId);
        return yxStoreBonusDetailMapper.toDto(yxStoreBonusDetail);
    }


}